const r = {
  aliyun: "https://szqerp.oss-cn-guangzhou.aliyuncs.com",
  "szqerp-prod": "http://api.szqerp.com/erp/static",
  "szqerp-dev": "http://apidev.szqerp.com/erp/static"
};
function i(s, n = location.href) {
  var p = new RegExp("(^|[&,?])" + s + "=([^&]*)(&|$)", "gi").exec(
    n
  ), e;
  return (e = p) ? e[2] : null;
}
function c(s, n = "osstype") {
  return s ? i(n, s) : "";
}
function f(s) {
  return !!/\.(jpg|jpeg|png|GIF|JPG|PNG)/.test(s);
}
function v(s) {
  var n = s && s.lastIndexOf && s.lastIndexOf("/");
  if (n >= 0) {
    var p = s.substr(0, n), e = s.substr(n + 1, s.length), t = e.indexOf("?");
    if (t >= 0) {
      var o = e.substr(0, t), u = e.substr(t + 1, e.length);
      u ? e = `${encodeURIComponent(o)}?${u}` : e = `${encodeURIComponent(o)}`;
    }
    if (e)
      return `${p}/${e}`;
  }
  return s;
}
function d(s, n = !1) {
  var p = s && s.indexOf("http") == 0, e = c(s, "osstype");
  return e || (e = c(s, "ossType")), e || (e = "szqerp-prod"), !p && e && (s = `${r[e]}/${v(s)}`), !n && f(s) && e === "aliyun" && (s += "&x-oss-process=image/resize,h_800,w_800"), n && (s = s.replace("&x-oss-process=image/resize,h_800,w_800", "")), s;
}
export {
  d as completeFilePath,
  c as getQueryParams,
  i as getUrlParam,
  r as ossType
};
